home *** CD-ROM | disk | FTP | other *** search
/ Almathera Ten Pack 3: CDPD 3 / Almathera Ten on Ten - Disc 3: CDPD3.iso / ab20 / unarced / datacomm / vltjr / rexx / vltmouse.rexx < prev    next >
OS/2 REXX Batch file  |  1995-03-17  |  1KB  |  51 lines

  1. /** VLTMouse.rexx
  2. *
  3. *   Example of how to receive mouse move messages from VLT and to
  4. *   extract the line the user clicked on.
  5. *
  6. **/
  7. address VLT
  8.  
  9. quitflag = 0
  10.  
  11. mp = openport('VLTMOUSE')
  12.  
  13. do forever
  14.    if quitflag = 1 then leave
  15.    t = waitpkt('VLTMOUSE')
  16.    do forever
  17.       p = getpkt('VLTMOUSE')
  18.       if c2d(p) = 0 then leave
  19.  
  20.       string = getarg(p)
  21.       t = reply(p, 0)
  22.  
  23.       parse var string yy xx yold xold ytot xtot qual
  24.  
  25.       "extract x"
  26.       "extract y"
  27.       "movecursor "||xx||" "||yy
  28.       "extract reviewlineatcursor"
  29.       "movecursor "||VLT.x||" "||VLT.y
  30.       str = VLT.reviewlineatcursor
  31.       
  32.       vltwidth  = ScreenCols("VLT")     /* Find size of VLT screen. */
  33.       vltheight = ScreenRows("VLT")
  34.       if vltwidth == -1 then do         /* If width was -1, it was */
  35.          vltwidth  = ScreenCols()       /* a Workbench window.     */
  36.          vltheight = ScreenRows()
  37.       end
  38.       vltwidth  = vltwidth-48
  39.       vltheight = vltheight-100
  40.  
  41.       if length(str) * 8 > vltwidth then str = left(str, vltwidth % 8)
  42.  
  43.       str = request(0, vltheight % 4, "Edit and send:", str, , "Cancel", VLT)
  44.       if str ~= "" then 'send raw ('||str||')'
  45.    end
  46. end
  47.  
  48. /* This example doesn't really ever: */
  49. exit
  50.  
  51.